package org.kuan.lab.base.util;

import java.util.ResourceBundle;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * Project: erp<br>
 * Description: 系统资源类，存储系统共有的属性。<br>
 * Copyright (c) 2012<br>
 * All Rights Reserved.<br>
 * @author <a href="mailto:gly420@163.com">GuanLuYong</a><br>
 */
@Component("sysres") @Scope("singleton")
public class AppAttributes {
	// 验证信息资源
	public static final ResourceBundle resValid = ResourceBundle.getBundle("validate");

	// 字典表类型
	public static final String ERP_DICT_TYPE_PARENT = "parent";
	public static final String ERP_DICT_TYPE_CHILD = "child";

	// 资源类型
	public static final String ERP_RESOURCE_TYPE = "ERP_RESOURCE_TYPE";
	public static final String ERP_RESOURCE_TYPE_MENU = "menu";

	// 权限分类
	public static final String ERP_RESOURCE_PERMISSION = "ERP_RESOURCE_PERMISSION"; // 权限根类
	public static final Long ERP_RESOURCE_PERMISSION_QUERY = 1L;
	public static final Long ERP_RESOURCE_PERMISSION_ADD = 2L;
	public static final Long ERP_RESOURCE_PERMISSION_MODIFY = 4L;
	public static final Long ERP_RESOURCE_PERMISSION_DROP = 8L;
	public static final Long ERP_RESOURCE_PERMISSION_CHECK = 16L;
	public static final Long ERP_RESOURCE_PERMISSION_COMMUNICATE = 32L;

	public static String getErpDictTypeParent() {
		return ERP_DICT_TYPE_PARENT;
	}

	public static String getErpDictTypeChild() {
		return ERP_DICT_TYPE_CHILD;
	}

	public static String getErpResourceType() {
		return ERP_RESOURCE_TYPE;
	}

	public static String getErpResourcePermission() {
		return ERP_RESOURCE_PERMISSION;
	}

}
